from tkinter import *

print('Введите X:')
X = int(input())
print('Введите Y:')
Y = int(input())
print('Введите коэффициент увеличения:')
k = int(input())

coords = [0,0,10,0,10,10,20,10,20,30,10,30,10,20,0,20]

if k == 0 and X>=0 and X<=500 and Y>=0 and Y<=500:
    pass
else:
    if k > 0 and 0*k+X>=0 and 0*k+Y>=0 and 20*k+X<=500 and 20*k+Y<=500:
        pass
    else:
        if k < 0 and 20*k+X>=0 and 20*k+Y>=0 and 0*k+X<=500 and 0*k+Y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")

canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_polygon(coords[0] *k+X, coords[1] *k+Y,
                      coords[2] *k+X, coords[3] *k+Y,
                      coords[4] *k+X, coords[5] *k+Y,
                      coords[6] *k+X, coords[7] *k+Y,
                      coords[8] *k+X, coords[9] *k+Y,
                      coords[10]*k+X, coords[11]*k+Y,
                      coords[12]*k+X, coords[13]*k+Y,
                      coords[14]*k+X, coords[15]*k+Y)



root.mainloop()
